﻿function GetTestBaseSub() {

	var myData = [
			['1', '1', '设备1','inside', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>All-Inside-Subnets","<img src='images/terminal.png'>Corp-Mail-Server","<img src='images/tcp.png'>Mail_Services","<img src='images/tick.png'>Permit","","Alerts","","Allow individual hosts to vpn to partner services",'2,3','优化','基线1','冲突'],
			['2', '2', '设备1','inside', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>FTP_Servers_inside<br><img src='images/terminallist.png'>Web_Servers_group","<img src='images/terminal.png'>10.0.101.0/24<br><img src='images/terminal.png'>10.0.102.0/24<br><img src='images/terminal.png'>10.0.100.0/24<br><img src='images/terminal.png'>10.0.103.0/24<br><img src='images/terminal.png'>10.0.104.0/24","<img src='images/tcp.png'>ftp<br><img src='images/tcp.png'>http<br><img src='images/tcp.png'>https<br><img src='images/tcp.png'>ssh","<img src='images/delete.png'>Deny","","Critical","","",'1,3','优化','基线2','冲突'],
			['3', '3', '设备1','inside', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>inside-network/24","<img src='images/terminal.png'>10.1.100.0/24","<img src='images/tcp.png'>ftp","<img src='images/tick.png'>Permit","","Warnings","","",'2,1','优化','基线3','部分冲突'],
			['4', '1', '设备2','outside', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>any","<img src='images/terminal.png'>WWW_Server","<img src='images/tcp.png'>http","<img src='images/tick.png'>Permit","","Warnings","","",'3','优化','基线4','冲突'],
			['5', '2', '设备2','outside', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>any","<img src='images/terminal.png'>DMZ-network","<img src='images/tcp.png'>http","<img src='images/tick.png'>Permit","","Warnings","","",'1','优化','基线5','冲突'],
			['6', '3', '设备2','outside', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>outside-network/24","<img src='images/terminal.png'>Ftp_Server","<img src='images/tcp.png'>ftp","<img src='images/tick.png'>Permit","","Warnings","","",'2','优化','基线6','部分冲突'],
			['7', '1', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>Remote-net-groups","<img src='images/terminal.png'>Web_Server_group","<img src='images/tcp.png'>HTTP-services","<img src='images/tick.png'>Permit","","Warnings","","",'2,3','优化','基线7','冲突'],
			['8', '2', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>10.1.100.0/24","<img src='images/terminal.png'>FTP_Server_group","<img src='images/tcp.png'>ftp","<img src='images/delete.png'>Deny","","Warnings","","",'1,3','优化','基线8','部分冲突'],
			['9', '3', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>partner-dmz-network","<img src='images/terminal.png'>Web_Server_group","<img src='images/tcp.png'>ip","<img src='images/tick.png'>Permit","","Warnings","","",'1,2','优化','基线9','部分冲突'],
			['10', '1','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>any","<img src='images/terminal.png'>Cisco","<img src='images/tcp.png'>HTTP-services","<img src='images/tick.png'>Permit","","Warnings","","",'3','优化','基线10','冲突'],
			['11', '2','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>any","<img src='images/terminal.png'>Youtube","<img src='images/tcp.png'>HTTP-services","<img src='images/delete.png'>Deny","","Warnings","","Marketing, and one of the sales people need access to Youtube for posting product videos",'3','优化','基线11','冲突'],
			['12', '3','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='images/terminallist.png'>any","<img src='images/terminal.png'>Facebook","<img src='images/tcp.png'>HTTP-services","<img src='images/tick.png'>Permit","","Warnings","","Allow only employees to visit Facebook",'2','优化','基线12','部分冲突']
	];



		
   // shared reader
    var reader = new Ext.data.ArrayReader({}, [
       			{
							name : 'id'
						}, {
							name : 'index'
						}, {
							name : 'devices'
						}, {
							name : 'type'
						}, {
							name : 'Enabled'
						}, {
							name : 'Source'
						}, {
							name : 'Destination'
						}, {
							name : 'Service'
						}, {
							name : 'Action'
						}, {
							name : 'Hits'
						}, {
							name : 'Logging'
						}, {
							name : 'Time'
						}, {
							name : 'Description'
						}, {
							name : 'relational'
						}, {
							name : 'status'
						}, {
							name : 'basename'
						}, {
							name : 'result'
						}
    ]);

    var store = new Ext.data.GroupingStore({
            reader: reader,
            data: myData,
            sortInfo:{field: 'id', direction: "ASC"},
            groupField:'type'
        });

	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [{
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '#',
							width : 10,
							sortable : true,
							dataIndex : 'index'
						}, {
							header : '接口',
							width : 70,
							sortable : true,
							dataIndex : 'type'
						}, {
							header : '源对象',
							width : 70,
							sortable : true,
							dataIndex : 'Source'
						}, {
							header : '目的对象',
							width : 100,
							sortable : true,
							dataIndex : 'Destination'
						}, {
							header : '服务',
							width : 70,
							sortable : true,
							dataIndex : 'Service'
						}, {
							header : '动作',
							width : 30,
							sortable : true,
							dataIndex : 'Action'
						}, {
							header : '命中量',
							width : 30,
							sortable : true,
							dataIndex : 'Hits'
						}, {
							header : '日志级别',
							width : 50,
							sortable : true,
							dataIndex : 'Logging'
						}, {
							header : '时间',
							width : 50,
							sortable : true,
							dataIndex : 'Time'
						}, {
							header : '描述',
							width : 70,
							sortable : true,
							dataIndex : 'Description'
						}, {
							header : '相关项',
							width : 70,
							sortable : true,
							dataIndex : 'relational'
						}, {
							header : '状态',
							width : 70,
							sortable : true,
							dataIndex : 'status'
						}, {
							header : '基线名称',
							width : 70,
							sortable : true,
							dataIndex : 'basename'
						}, {
							header : '检测结果',
							width : 70,
							sortable : true,
							dataIndex : 'result'
						}],
				sm : sm,
				view: new Ext.grid.GroupingView({
		            forceFit:true,
		            startCollapsed : false ,
		            groupTextTpl: '{gvalue}'
		        }),
				
				tbar : [
				
						 {
							text : '查找',
							tooltip : '查找',
							iconCls : 'search',
							handler : function() {							
							}
						}],
				
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'testbasesubgrid'
			});

	return grid;
}